package com.imooc.modular.validator;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;


/**
 * 自定义validator 注解校验逻辑
 *
 * @author yuelinbo
 * @date 2019/2/12 12:11
 **/
public class MyConstraintValidator implements ConstraintValidator<MyConstraint,Object>  {

    @Override
    public void initialize(MyConstraint constraintAnnotation) {
        System.out.println("my validator is init");
    }

    @Override
    public boolean isValid(Object o, ConstraintValidatorContext constraintValidatorContext) {

        System.out.println(o);


        return false;
    }
}
